package com.example.administrator.myapplication.fragments;


import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;

import com.example.administrator.myapplication.R;
import com.example.administrator.myapplication.SyOneActivity;
import com.example.administrator.myapplication.SyTwoActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class SyFragment extends Fragment {

    ImageButton mTbdaikuan;
    ImageButton mTbShuidian;




    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_sy, container, false);
        mTbdaikuan = view.findViewById(R.id.daikuan);
        mTbShuidian = view.findViewById(R.id.shuidian);
        return view;
    }
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mTbdaikuan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), SyOneActivity.class);
                startActivity(intent);
            }
        });
        mTbShuidian.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), SyTwoActivity.class);
                startActivity(intent);
            }
        });
    }

}
